import request from '@/utils/request'

// 查询同步轮类型集合
export function getTpTypeList(query) {
  return request({
    url: '/hualian/type/tpTypeList',
    method: 'get'
  })
}

// 查询同步轮材质集合
export function getTpMaterialList(query) {
  return request({
    url: '/hualian/type/tpMaterialList',
    method: 'get'
  })
}

// 查询同步轮材质集合
export function getTpToothList(tpType) {
  return request({
    url: '/hualian/type/tpToothList/' + tpType,
    method: 'get'
  })
}

// 查询同步轮齿形对应的带宽集合
export function getTpBandwidthList(tpTooth) {
  return request({
    url: '/hualian/type/tpBandwidth/' + tpTooth,
    method: 'get'
  })
}

// 查询同步轮齿数集合
export function getTpTeethNumList(parameter) {
  return request({
    url: '/hualian/type/tpTeethNum/' + parameter,
    method: 'get'
  })
}

// 查询同步轮形状集合
export function getTpShapeList(tpType) {
  return request({
    url: '/hualian/type/tpShape/' + tpType,
    method: 'get'
  })
}

// 查询同步轮轴孔类型集合
export function getTpAxleHoleTypeList(tpType, chooseTpShape) {
  return request({
    url: '/hualian/type/tpAxleHoleType?' + 'tpType=' + tpType + "&" + 'chooseTpShape=' + chooseTpShape,
    method: 'get'
  })
}

// 查询华链同步轮及相关产品成本和利润
export function getTpCostPrice(data) {
  return request({
    url: '/huaLian/timingPulley/costPrice',
    method: 'post',
    params: data
  })
}

// 查询华链同步轮及相关产品成本和利润
export function getTpCostPriceTourist(data) {
  return request({
    url: '/huaLian/timingPulley/costPriceTourist',
    method: 'post',
    params: data
  })
}

// 怡和达同步轮类型转换网站
export function getYiHeDaTypeConvertWebsite(yiHeDaTypeCommodity) {
  return request({
    url: '/huaLian/timingPulley/yiHeDaTypeConvertWebsite/' + yiHeDaTypeCommodity,
    method: 'get'
  })
}

// 米思米同步轮类型转换网站
export function getMiSiMiTypeConvertWebsite(miSiMiTypeCommodity) {
  return request({
    url: '/huaLian/timingPulley/miSiMiTypeConvertWebsite/' + miSiMiTypeCommodity,
    method: 'get'
  })
}

// 爱安特同步轮类型转换网站
export function getAiAnTeTypeConvertWebsite(aiAnTeTypeCommodity) {
  return request({
    url: '/huaLian/timingPulley/aiAnTeTypeConvertWebsite/' + aiAnTeTypeCommodity,
    method: 'get'
  })
}

// 上隆同步轮类型转换网站
export function getShangLongTypeConvertWebsite(shangLongTypeCommodity) {
  return request({
    url: '/huaLian/timingPulley/shangLongTypeConvertWebsite/' + shangLongTypeCommodity,
    method: 'get'
  })
}

// 输入前置型号，获取转换后的型号
export function GetTransFormSkuNumByValue(param) {
  return request({
    url: '/huaLian/timingPulley/strangeTypeConvertWebsite/' + param,
    method: 'get'
  })
}

// 输入前置型号，获取转换后的型号
export function getBeltCalculation(param) {
  return request({
    url: '/huaLian/excel/beltCalculation',
    method: 'post',
    params: param
  })
}

/**
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */


// 查询同步轮列表
export function listType(query) {
  return request({
    url: '/hualian/type/list',
    method: 'get',
    params: query
  })
}

// 查询同步轮详细
export function getType(typeId) {
  return request({
    url: '/hualian/type/' + typeId,
    method: 'get'
  })
}

// 新增同步轮
export function addType(data) {
  return request({
    url: '/hualian/type',
    method: 'post',
    data: data
  })
}

// 修改同步轮
export function updateType(data) {
  return request({
    url: '/hualian/type',
    method: 'put',
    data: data
  })
}

// 删除同步轮
export function delType(typeId) {
  return request({
    url: '/hualian/type/' + typeId,
    method: 'delete'
  })
}
